package com.leadership.api.dao;

import java.util.List;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import com.leadership.entity.Notification;
import com.leadership.entity.NotificationTemplate;
import com.leadership.entity.NotificationType;

/**
 * 
 * @author dan
 *
 */
@Dao("hibernate")
public interface NotificationDao {
    
    /**
     * 
     * @param send
     * @return
     */
    @Query("FROM Notification WHERE disabled = false AND send = :send")
    public List<Notification> list(@Variable("send") boolean send);
    
    /**
     * 
     * @param type
     * @return
     */
    @Query("FROM NotificationTemplate WHERE disabled = false AND type = :type")
    public NotificationTemplate loadTemplate(@Variable("type") NotificationType type);

}
